package com.lyf.filter;

import org.springframework.cloud.gateway.filter.GatewayFilterChain;
import org.springframework.cloud.gateway.filter.GlobalFilter;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;

/**
 * @AUTHOR LYF
 * @DATE 2022/2/6
 * @VERSION 1.0
 * @DESC
 */
@Configuration
public class Filter2 implements GlobalFilter, Ordered {
    @Override
    public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {

        System.out.println("2...");
        return chain.filter(exchange);
    }

    @Override
    public int getOrder() {
        return 2;
    }
}
